package sctu.edu.java.year2016.team03.zhaoyong.day20160522.chapter5_2;

/**
 * 创建一个arr[]数组，并输出数组最大值
 * Created by zhaoyong on 2016/5/23.
 */
public class woow {
    public static void main(String[] args) {
        int[] arr = {1, 2, 3, 4, 5};
        for (int i = 0; i < 5; i++) {
            System.out.print(arr[i] + "\t");
        }
        int max = arr[0];
        for (int j = 0; j < 5; j++) {
            if (max < arr[j])
                max = arr[j];
        }
        System.out.println("最大值是：" + max);
    }
}
